﻿using System;
using System.Collections.Generic;
using IInject.Collections;

namespace IInject.Registration
{
	public abstract class RegistryBase<T> : TypedCollection<T>, IRegistry
	{
		#region Constructors

		public RegistryBase(IContainer container) : base(container)
		{
		}

		#endregion

		#region Methods

		public abstract bool Contains(Type type, string key);

		public abstract RegistryContext Get(Type type, string key);

        public abstract IEnumerable<RegistryContext> GetAll(Type type, string key);

		public abstract bool Register(Type from, RegistryContext context);

		public abstract bool Register(Type from, string key, IEnumerable<RegistryContext> contexts);

		public override string ToString()
		{
			return string.Format("RegistryType: {0}, ItemsRegistered: {1}", GetType().Name, Count);
		}

		#endregion
	}
}
